// Created from GenerationTemplate
// For Decisions HL7 Engine
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.Reflection;
using DecisionsFramework.Design.Properties;
using Decisions.HL7.Generated.AbstractMessage;
using Decisions.HL7.DataTypes;
using ST = System.String;
using SI = System.String;
using TX = System.String;
using FT = System.String;
using IS = System.String;
using ID = System.String;
using SNM = System.String;

namespace Decisions.HL7.Message
{
    [DataContract]
	public class IAM : AbstractSegment
    {

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("1 Set ID - IAM",1)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.True,"SI")]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.True,"SI")]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.True,"SI")]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.True,"SI")]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.True,"SI")]
	    public SI SetIDIAM {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("2 Allergen Type Code",2)]
  	    [HL7Field(HL7Version.v24, 2, HL7Repeat.False, HL7Required.True,"CE_0127")]
  	    [HL7Field(HL7Version.v25, 2, HL7Repeat.False, HL7Required.True,"CE")]
  	    [HL7Field(HL7Version.v251, 2, HL7Repeat.False, HL7Required.True,"CE")]
  	    [HL7Field(HL7Version.v26, 2, HL7Repeat.False, HL7Required.True,"CWE")]
  	    [HL7Field(HL7Version.v27, 2, HL7Repeat.False, HL7Required.True,"CWE")]
		[AllergenType]
	    public CWE AllergenTypeCode {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("3 Allergen Code/Mnemonic/Description",3)]
  	    [HL7Field(HL7Version.v24, 3, HL7Repeat.False, HL7Required.True,"CE")]
  	    [HL7Field(HL7Version.v25, 3, HL7Repeat.False, HL7Required.True,"CE")]
  	    [HL7Field(HL7Version.v251, 3, HL7Repeat.False, HL7Required.True,"CE")]
  	    [HL7Field(HL7Version.v26, 3, HL7Repeat.False, HL7Required.True,"CWE")]
  	    [HL7Field(HL7Version.v27, 3, HL7Repeat.False, HL7Required.True,"CWE")]
	    public CWE AllergenCodeMnemonicDescription {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("4 Allergy Severity Code",4)]
  	    [HL7Field(HL7Version.v24, 4, HL7Repeat.False, HL7Required.True,"CE_0128")]
  	    [HL7Field(HL7Version.v25, 4, HL7Repeat.False, HL7Required.True,"CE")]
  	    [HL7Field(HL7Version.v251, 4, HL7Repeat.False, HL7Required.True,"CE")]
  	    [HL7Field(HL7Version.v26, 4, HL7Repeat.False, HL7Required.True,"CWE")]
  	    [HL7Field(HL7Version.v27, 4, HL7Repeat.False, HL7Required.True,"CWE")]
		[AllergySeverity]
	    public CWE AllergySeverityCode {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("5 Allergy Reaction Code",5)]
  	    [HL7Field(HL7Version.v24, 5, HL7Repeat.True, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v25, 5, HL7Repeat.True, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v251, 5, HL7Repeat.True, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v26, 5, HL7Repeat.True, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v27, 5, HL7Repeat.True, HL7Required.True,"ST")]
	    public ST[] AllergyReactionCode {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("6 Allergy Action Code",6)]
  	    [HL7Field(HL7Version.v24, 6, HL7Repeat.False, HL7Required.True,"CNE")]
  	    [HL7Field(HL7Version.v25, 6, HL7Repeat.False, HL7Required.True,"CNE")]
  	    [HL7Field(HL7Version.v251, 6, HL7Repeat.False, HL7Required.True,"CNE")]
  	    [HL7Field(HL7Version.v26, 6, HL7Repeat.False, HL7Required.True,"CNE")]
  	    [HL7Field(HL7Version.v27, 6, HL7Repeat.False, HL7Required.True,"CNE")]
		[Segmentactioncode]
	    public CNE AllergyActionCode {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("7 Allergy Unique Identifier",7)]
  	    [HL7Field(HL7Version.v24, 7, HL7Repeat.False, HL7Required.True,"EI")]
  	    [HL7Field(HL7Version.v25, 7, HL7Repeat.False, HL7Required.True,"EI")]
  	    [HL7Field(HL7Version.v251, 7, HL7Repeat.False, HL7Required.True,"EI")]
  	    [HL7Field(HL7Version.v26, 7, HL7Repeat.False, HL7Required.True,"EI")]
  	    [HL7Field(HL7Version.v27, 7, HL7Repeat.False, HL7Required.True,"EI")]
	    public EI AllergyUniqueIdentifier {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("8 Action Reason",8)]
  	    [HL7Field(HL7Version.v24, 8, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v25, 8, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v251, 8, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v26, 8, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v27, 8, HL7Repeat.False, HL7Required.True,"ST")]
	    public ST ActionReason {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("9 Sensitivity to Causative Agent Code",9)]
  	    [HL7Field(HL7Version.v24, 9, HL7Repeat.False, HL7Required.True,"CE_0436")]
  	    [HL7Field(HL7Version.v25, 9, HL7Repeat.False, HL7Required.True,"CE")]
  	    [HL7Field(HL7Version.v251, 9, HL7Repeat.False, HL7Required.True,"CE")]
  	    [HL7Field(HL7Version.v26, 9, HL7Repeat.False, HL7Required.True,"CWE")]
  	    [HL7Field(HL7Version.v27, 9, HL7Repeat.False, HL7Required.True,"CWE")]
		[SensitivitytoCausativeAgentCode]
	    public CWE SensitivitytoCausativeAgentCode {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("10 Allergen Group Code/Mnemonic/Description",10)]
  	    [HL7Field(HL7Version.v24, 10, HL7Repeat.False, HL7Required.True,"CE")]
  	    [HL7Field(HL7Version.v25, 10, HL7Repeat.False, HL7Required.True,"CE")]
  	    [HL7Field(HL7Version.v251, 10, HL7Repeat.False, HL7Required.True,"CE")]
  	    [HL7Field(HL7Version.v26, 10, HL7Repeat.False, HL7Required.True,"CWE")]
  	    [HL7Field(HL7Version.v27, 10, HL7Repeat.False, HL7Required.True,"CWE")]
	    public CWE AllergenGroupCodeMnemonicDescription {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("11 Onset Date",11)]
  	    [HL7Field(HL7Version.v24, 11, HL7Repeat.False, HL7Required.True,"DT")]
  	    [HL7Field(HL7Version.v25, 11, HL7Repeat.False, HL7Required.True,"DT")]
  	    [HL7Field(HL7Version.v251, 11, HL7Repeat.False, HL7Required.True,"DT")]
  	    [HL7Field(HL7Version.v26, 11, HL7Repeat.False, HL7Required.True,"DT")]
  	    [HL7Field(HL7Version.v27, 11, HL7Repeat.False, HL7Required.True,"DT")]
	    public DT OnsetDate {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("12 Onset Date Text",12)]
  	    [HL7Field(HL7Version.v24, 12, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v25, 12, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v251, 12, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v26, 12, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v27, 12, HL7Repeat.False, HL7Required.True,"ST")]
	    public ST OnsetDateText {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("13 Reported Date/Time",13)]
  	    [HL7Field(HL7Version.v24, 13, HL7Repeat.False, HL7Required.True,"TS")]
  	    [HL7Field(HL7Version.v25, 13, HL7Repeat.False, HL7Required.True,"TS")]
  	    [HL7Field(HL7Version.v251, 13, HL7Repeat.False, HL7Required.True,"TS")]
  	    [HL7Field(HL7Version.v26, 13, HL7Repeat.False, HL7Required.True,"DTM")]
  	    [HL7Field(HL7Version.v27, 13, HL7Repeat.False, HL7Required.True,"DTM")]
	    public DTM ReportedDateTime {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("14 Reported By",14)]
  	    [HL7Field(HL7Version.v24, 14, HL7Repeat.False, HL7Required.True,"XPN")]
  	    [HL7Field(HL7Version.v25, 14, HL7Repeat.False, HL7Required.True,"XPN")]
  	    [HL7Field(HL7Version.v251, 14, HL7Repeat.False, HL7Required.True,"XPN")]
  	    [HL7Field(HL7Version.v26, 14, HL7Repeat.False, HL7Required.True,"XPN")]
  	    [HL7Field(HL7Version.v27, 14, HL7Repeat.False, HL7Required.True,"XPN")]
	    public XPN ReportedBy {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("15 Relationship to Patient Code",15)]
  	    [HL7Field(HL7Version.v24, 15, HL7Repeat.False, HL7Required.True,"CE_0063")]
  	    [HL7Field(HL7Version.v25, 15, HL7Repeat.False, HL7Required.True,"CE")]
  	    [HL7Field(HL7Version.v251, 15, HL7Repeat.False, HL7Required.True,"CE")]
  	    [HL7Field(HL7Version.v26, 15, HL7Repeat.False, HL7Required.True,"CWE")]
  	    [HL7Field(HL7Version.v27, 15, HL7Repeat.False, HL7Required.True,"CWE")]
		[Relationship]
	    public CWE RelationshiptoPatientCode {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("16 Alert Device Code",16)]
  	    [HL7Field(HL7Version.v24, 16, HL7Repeat.False, HL7Required.True,"CE_0437")]
  	    [HL7Field(HL7Version.v25, 16, HL7Repeat.False, HL7Required.True,"CE")]
  	    [HL7Field(HL7Version.v251, 16, HL7Repeat.False, HL7Required.True,"CE")]
  	    [HL7Field(HL7Version.v26, 16, HL7Repeat.False, HL7Required.True,"CWE")]
  	    [HL7Field(HL7Version.v27, 16, HL7Repeat.False, HL7Required.True,"CWE")]
		[AlertDeviceCode]
	    public CWE AlertDeviceCode {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("17 Allergy Clinical Status Code",17)]
  	    [HL7Field(HL7Version.v24, 17, HL7Repeat.False, HL7Required.True,"CE_0438")]
  	    [HL7Field(HL7Version.v25, 17, HL7Repeat.False, HL7Required.True,"CE")]
  	    [HL7Field(HL7Version.v251, 17, HL7Repeat.False, HL7Required.True,"CE")]
  	    [HL7Field(HL7Version.v26, 17, HL7Repeat.False, HL7Required.True,"CWE")]
  	    [HL7Field(HL7Version.v27, 17, HL7Repeat.False, HL7Required.True,"CWE")]
		[AllergyClinicalStatus]
	    public CWE AllergyClinicalStatusCode {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("18 Statused by Person",18)]
  	    [HL7Field(HL7Version.v24, 18, HL7Repeat.False, HL7Required.True,"XCN")]
  	    [HL7Field(HL7Version.v25, 18, HL7Repeat.False, HL7Required.True,"XCN")]
  	    [HL7Field(HL7Version.v251, 18, HL7Repeat.False, HL7Required.True,"XCN")]
  	    [HL7Field(HL7Version.v26, 18, HL7Repeat.False, HL7Required.True,"XCN")]
  	    [HL7Field(HL7Version.v27, 18, HL7Repeat.False, HL7Required.True,"XCN")]
	    public XCN StatusedbyPerson {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("19 Statused by Organization",19)]
  	    [HL7Field(HL7Version.v24, 19, HL7Repeat.False, HL7Required.True,"XON")]
  	    [HL7Field(HL7Version.v25, 19, HL7Repeat.False, HL7Required.True,"XON")]
  	    [HL7Field(HL7Version.v251, 19, HL7Repeat.False, HL7Required.True,"XON")]
  	    [HL7Field(HL7Version.v26, 19, HL7Repeat.False, HL7Required.True,"XON")]
  	    [HL7Field(HL7Version.v27, 19, HL7Repeat.False, HL7Required.True,"XON")]
	    public XON StatusedbyOrganization {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("20 Statused at Date/Time",20)]
  	    [HL7Field(HL7Version.v24, 20, HL7Repeat.False, HL7Required.True,"TS")]
  	    [HL7Field(HL7Version.v25, 20, HL7Repeat.False, HL7Required.True,"TS")]
  	    [HL7Field(HL7Version.v251, 20, HL7Repeat.False, HL7Required.True,"TS")]
  	    [HL7Field(HL7Version.v26, 20, HL7Repeat.False, HL7Required.True,"DTM")]
  	    [HL7Field(HL7Version.v27, 20, HL7Repeat.False, HL7Required.True,"DTM")]
	    public DTM StatusedatDateTime {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("21 Inactivated by Person",21)]
  	    [HL7Field(HL7Version.v27, 21, HL7Repeat.False, HL7Required.True,"XCN")]
	    public XCN InactivatedbyPerson {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("22 Inactivated Date/Time",22)]
  	    [HL7Field(HL7Version.v27, 22, HL7Repeat.False, HL7Required.True,"DTM")]
	    public DTM InactivatedDateTime {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("23 Initially Recorded by Person",23)]
  	    [HL7Field(HL7Version.v27, 23, HL7Repeat.False, HL7Required.True,"XCN")]
	    public XCN InitiallyRecordedbyPerson {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("24 Initially Recorded Date/Time",24)]
  	    [HL7Field(HL7Version.v27, 24, HL7Repeat.False, HL7Required.True,"DTM")]
	    public DTM InitiallyRecordedDateTime {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("25 Modified by Person",25)]
  	    [HL7Field(HL7Version.v27, 25, HL7Repeat.False, HL7Required.True,"XCN")]
	    public XCN ModifiedbyPerson {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("26 Modified Date/Time",26)]
  	    [HL7Field(HL7Version.v27, 26, HL7Repeat.False, HL7Required.True,"DTM")]
	    public DTM ModifiedDateTime {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("27 Clinician Identified Code",27)]
  	    [HL7Field(HL7Version.v27, 27, HL7Repeat.False, HL7Required.True,"CWE")]
	    public CWE ClinicianIdentifiedCode {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("28 Initially Recorded by Organization",28)]
  	    [HL7Field(HL7Version.v27, 28, HL7Repeat.False, HL7Required.True,"XON")]
	    public XON InitiallyRecordedbyOrganization {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("29 Modified by Organization",29)]
  	    [HL7Field(HL7Version.v27, 29, HL7Repeat.False, HL7Required.True,"XON")]
	    public XON ModifiedbyOrganization {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("30 Inactivated by Organization",30)]
  	    [HL7Field(HL7Version.v27, 30, HL7Repeat.False, HL7Required.True,"XON")]
	    public XON InactivatedbyOrganization {get;set;}


	    [DataMember]
        [PropertyClassification("AdditionalValue1", 31)]
		[HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.False)]
		public string AdditionalValue1 { get; set; }

		    [DataMember]
        [PropertyClassification("AdditionalValue2", 32)]
		[HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.False)]
		public string AdditionalValue2 { get; set; }

		    [DataMember]
        [PropertyClassification("AdditionalValue3", 33)]
		[HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.False)]
		public string AdditionalValue3 { get; set; }

		    [DataMember]
        [PropertyClassification("AdditionalValue4", 34)]
		[HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.False)]
		public string AdditionalValue4 { get; set; }

		    [DataMember]
        [PropertyClassification("AdditionalValue5", 35)]
		[HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.False)]
		public string AdditionalValue5 { get; set; }

		    [DataMember]
        [PropertyClassification("AdditionalValue6", 36)]
		[HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.False)]
		public string AdditionalValue6 { get; set; }

		    [DataMember]
        [PropertyClassification("AdditionalValue7", 37)]
		[HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.False)]
		public string AdditionalValue7 { get; set; }

		    [DataMember]
        [PropertyClassification("AdditionalValue8", 38)]
		[HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.False)]
		public string AdditionalValue8 { get; set; }

		    [DataMember]
        [PropertyClassification("AdditionalValue9", 39)]
		[HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.False)]
		public string AdditionalValue9 { get; set; }

		    [DataMember]
        [PropertyClassification("AdditionalValue10", 40)]
		[HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.False)]
		public string AdditionalValue10 { get; set; }

		    [DataMember]
        [PropertyClassification("AdditionalValue11", 41)]
		[HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.False)]
		public string AdditionalValue11 { get; set; }

		    [DataMember]
        [PropertyClassification("AdditionalValue12", 42)]
		[HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.False)]
		public string AdditionalValue12 { get; set; }

		    [DataMember]
        [PropertyClassification("AdditionalValue13", 43)]
		[HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.False)]
		public string AdditionalValue13 { get; set; }

		    [DataMember]
        [PropertyClassification("AdditionalValue14", 44)]
		[HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.False)]
		public string AdditionalValue14 { get; set; }

		    [DataMember]
        [PropertyClassification("AdditionalValue15", 45)]
		[HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.False)]
		public string AdditionalValue15 { get; set; }

		    [DataMember]
        [PropertyClassification("AdditionalValue16", 46)]
		[HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.False)]
		public string AdditionalValue16 { get; set; }

		    [DataMember]
        [PropertyClassification("AdditionalValue17", 47)]
		[HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.False)]
		public string AdditionalValue17 { get; set; }

		    [DataMember]
        [PropertyClassification("AdditionalValue18", 48)]
		[HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.False)]
		public string AdditionalValue18 { get; set; }

		    [DataMember]
        [PropertyClassification("AdditionalValue19", 49)]
		[HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.False)]
		public string AdditionalValue19 { get; set; }

		    [DataMember]
        [PropertyClassification("AdditionalValue20", 50)]
		[HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.False)]
		public string AdditionalValue20 { get; set; }

	

		internal override void ConsumeTextSegment(string segmentTextData, HL7ParserOptions options)
		{
			string[] segmentTextParts = segmentTextData.Split(new char[] { options.FieldSep }, StringSplitOptions.None);
			SetIDIAM = (SI)ParseTextAtPositionIntoData(segmentTextParts, 1, options, typeof(SI), "IAM.1");
			AllergenTypeCode = (CWE)ParseTextAtPositionIntoData(segmentTextParts, 2, options, typeof(CWE), "IAM.2");
			AllergenCodeMnemonicDescription = (CWE)ParseTextAtPositionIntoData(segmentTextParts, 3, options, typeof(CWE), "IAM.3");
			AllergySeverityCode = (CWE)ParseTextAtPositionIntoData(segmentTextParts, 4, options, typeof(CWE), "IAM.4");
	    	AllergyReactionCode = (ST[])ParseTextAtPositionIntoDataArray<ST>(segmentTextParts, 5, options, "IAM.5");
			AllergyActionCode = (CNE)ParseTextAtPositionIntoData(segmentTextParts, 6, options, typeof(CNE), "IAM.6");
			AllergyUniqueIdentifier = (EI)ParseTextAtPositionIntoData(segmentTextParts, 7, options, typeof(EI), "IAM.7");
			ActionReason = (ST)ParseTextAtPositionIntoData(segmentTextParts, 8, options, typeof(ST), "IAM.8");
			SensitivitytoCausativeAgentCode = (CWE)ParseTextAtPositionIntoData(segmentTextParts, 9, options, typeof(CWE), "IAM.9");
			AllergenGroupCodeMnemonicDescription = (CWE)ParseTextAtPositionIntoData(segmentTextParts, 10, options, typeof(CWE), "IAM.10");
			OnsetDate = (DT)ParseTextAtPositionIntoData(segmentTextParts, 11, options, typeof(DT), "IAM.11");
			OnsetDateText = (ST)ParseTextAtPositionIntoData(segmentTextParts, 12, options, typeof(ST), "IAM.12");
			ReportedDateTime = (DTM)ParseTextAtPositionIntoData(segmentTextParts, 13, options, typeof(DTM), "IAM.13");
			ReportedBy = (XPN)ParseTextAtPositionIntoData(segmentTextParts, 14, options, typeof(XPN), "IAM.14");
			RelationshiptoPatientCode = (CWE)ParseTextAtPositionIntoData(segmentTextParts, 15, options, typeof(CWE), "IAM.15");
			AlertDeviceCode = (CWE)ParseTextAtPositionIntoData(segmentTextParts, 16, options, typeof(CWE), "IAM.16");
			AllergyClinicalStatusCode = (CWE)ParseTextAtPositionIntoData(segmentTextParts, 17, options, typeof(CWE), "IAM.17");
			StatusedbyPerson = (XCN)ParseTextAtPositionIntoData(segmentTextParts, 18, options, typeof(XCN), "IAM.18");
			StatusedbyOrganization = (XON)ParseTextAtPositionIntoData(segmentTextParts, 19, options, typeof(XON), "IAM.19");
			StatusedatDateTime = (DTM)ParseTextAtPositionIntoData(segmentTextParts, 20, options, typeof(DTM), "IAM.20");
			InactivatedbyPerson = (XCN)ParseTextAtPositionIntoData(segmentTextParts, 21, options, typeof(XCN), "IAM.21");
			InactivatedDateTime = (DTM)ParseTextAtPositionIntoData(segmentTextParts, 22, options, typeof(DTM), "IAM.22");
			InitiallyRecordedbyPerson = (XCN)ParseTextAtPositionIntoData(segmentTextParts, 23, options, typeof(XCN), "IAM.23");
			InitiallyRecordedDateTime = (DTM)ParseTextAtPositionIntoData(segmentTextParts, 24, options, typeof(DTM), "IAM.24");
			ModifiedbyPerson = (XCN)ParseTextAtPositionIntoData(segmentTextParts, 25, options, typeof(XCN), "IAM.25");
			ModifiedDateTime = (DTM)ParseTextAtPositionIntoData(segmentTextParts, 26, options, typeof(DTM), "IAM.26");
			ClinicianIdentifiedCode = (CWE)ParseTextAtPositionIntoData(segmentTextParts, 27, options, typeof(CWE), "IAM.27");
			InitiallyRecordedbyOrganization = (XON)ParseTextAtPositionIntoData(segmentTextParts, 28, options, typeof(XON), "IAM.28");
			ModifiedbyOrganization = (XON)ParseTextAtPositionIntoData(segmentTextParts, 29, options, typeof(XON), "IAM.29");
			InactivatedbyOrganization = (XON)ParseTextAtPositionIntoData(segmentTextParts, 30, options, typeof(XON), "IAM.30");
		}

		public string GetER7(HL7ParserOptions options) {
			List<string> segmentParts = new List<string>();
			segmentParts.Add("IAM");
		    segmentParts.Add(SetIDIAM);
			segmentParts.Add(GetER7TextForSegmentPart(AllergenTypeCode, options));
			segmentParts.Add(GetER7TextForSegmentPart(AllergenCodeMnemonicDescription, options));
			segmentParts.Add(GetER7TextForSegmentPart(AllergySeverityCode, options));
		    segmentParts.Add(ConvertStringArray(AllergyReactionCode, options));
			segmentParts.Add(GetER7TextForSegmentPart(AllergyActionCode, options));
			segmentParts.Add(GetER7TextForSegmentPart(AllergyUniqueIdentifier, options));
		    segmentParts.Add(ActionReason);
			segmentParts.Add(GetER7TextForSegmentPart(SensitivitytoCausativeAgentCode, options));
			segmentParts.Add(GetER7TextForSegmentPart(AllergenGroupCodeMnemonicDescription, options));
			segmentParts.Add(GetER7TextForSegmentPart(OnsetDate, options));
		    segmentParts.Add(OnsetDateText);
			segmentParts.Add(GetER7TextForSegmentPart(ReportedDateTime, options));
			segmentParts.Add(GetER7TextForSegmentPart(ReportedBy, options));
			segmentParts.Add(GetER7TextForSegmentPart(RelationshiptoPatientCode, options));
			segmentParts.Add(GetER7TextForSegmentPart(AlertDeviceCode, options));
			segmentParts.Add(GetER7TextForSegmentPart(AllergyClinicalStatusCode, options));
			segmentParts.Add(GetER7TextForSegmentPart(StatusedbyPerson, options));
			segmentParts.Add(GetER7TextForSegmentPart(StatusedbyOrganization, options));
			segmentParts.Add(GetER7TextForSegmentPart(StatusedatDateTime, options));
			segmentParts.Add(GetER7TextForSegmentPart(InactivatedbyPerson, options));
			segmentParts.Add(GetER7TextForSegmentPart(InactivatedDateTime, options));
			segmentParts.Add(GetER7TextForSegmentPart(InitiallyRecordedbyPerson, options));
			segmentParts.Add(GetER7TextForSegmentPart(InitiallyRecordedDateTime, options));
			segmentParts.Add(GetER7TextForSegmentPart(ModifiedbyPerson, options));
			segmentParts.Add(GetER7TextForSegmentPart(ModifiedDateTime, options));
			segmentParts.Add(GetER7TextForSegmentPart(ClinicianIdentifiedCode, options));
			segmentParts.Add(GetER7TextForSegmentPart(InitiallyRecordedbyOrganization, options));
			segmentParts.Add(GetER7TextForSegmentPart(ModifiedbyOrganization, options));
			segmentParts.Add(GetER7TextForSegmentPart(InactivatedbyOrganization, options));
			return string.Join("" + options.FieldSep, segmentParts.ToArray());
		}

    }
}

